"""
Default styling configuration for presentations.
"""

from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN
from pptx.dml.color import RGBColor


class DefaultStyles:
    """Default styling configuration for MD2PPT presentations."""
    
    # Slide dimensions (16:9 aspect ratio)
    SLIDE_WIDTH = Inches(13.33)
    SLIDE_HEIGHT = Inches(7.5)
    
    # Colors
    BACKGROUND_COLOR = RGBColor(255, 255, 255)  # White
    PRIMARY_COLOR = RGBColor(68, 114, 196)      # Blue
    TEXT_COLOR = RGBColor(0, 0, 0)              # Black
    SECONDARY_COLOR = RGBColor(128, 128, 128)   # Gray
    
    # Fonts
    DEFAULT_FONT_NAME = "Microsoft YaHei"  # Microsoft YaHei for Chinese/Windows
    FALLBACK_FONT_NAME = "Arial"   # Fallback for other systems
    
    # Title slide styles
    TITLE_FONT_SIZE = Pt(44)
    TITLE_FONT_BOLD = True
    TITLE_ALIGNMENT = PP_ALIGN.CENTER
    TITLE_COLOR = PRIMARY_COLOR
    
    # Content slide styles
    SLIDE_TITLE_FONT_SIZE = Pt(32)
    SLIDE_TITLE_FONT_BOLD = True
    SLIDE_TITLE_ALIGNMENT = PP_ALIGN.LEFT
    SLIDE_TITLE_COLOR = PRIMARY_COLOR
    
    # Body text styles
    BODY_FONT_SIZE = Pt(20)
    BODY_FONT_BOLD = False
    BODY_ALIGNMENT = PP_ALIGN.LEFT
    BODY_COLOR = TEXT_COLOR
    
    # Bullet list styles
    BULLET_FONT_SIZE = Pt(18)
    BULLET_FONT_BOLD = False
    BULLET_ALIGNMENT = PP_ALIGN.LEFT
    BULLET_COLOR = TEXT_COLOR
    BULLET_INDENT = Inches(0.5)
    
    # Image styles
    IMAGE_MAX_WIDTH_RATIO = 0.7    # 70% of slide width
    IMAGE_MAX_HEIGHT_RATIO = 0.6   # 60% of slide height
    
    # Layout margins and spacing
    CONTENT_MARGIN_TOP = Inches(1.5)
    CONTENT_MARGIN_LEFT = Inches(1.0)
    CONTENT_MARGIN_RIGHT = Inches(1.0)
    CONTENT_MARGIN_BOTTOM = Inches(1.0)
    
    # Title positioning
    TITLE_TOP = Inches(2.5)
    TITLE_LEFT = Inches(1.0)
    TITLE_WIDTH = SLIDE_WIDTH - Inches(2.0)
    TITLE_HEIGHT = Inches(1.5)
    
    # Content positioning for slides
    SLIDE_TITLE_TOP = Inches(0.5)
    SLIDE_TITLE_LEFT = Inches(1.0)
    SLIDE_TITLE_WIDTH = SLIDE_WIDTH - Inches(2.0)
    SLIDE_TITLE_HEIGHT = Inches(1.0)
    
    SLIDE_CONTENT_TOP = Inches(1.8)
    SLIDE_CONTENT_LEFT = Inches(1.0)
    SLIDE_CONTENT_WIDTH = SLIDE_WIDTH - Inches(2.0)
    SLIDE_CONTENT_HEIGHT = SLIDE_HEIGHT - Inches(2.8)


class ThemeColors:
    """Predefined color themes."""
    
    BLUE_THEME = {
        'primary': RGBColor(68, 114, 196),
        'secondary': RGBColor(142, 169, 219),
        'text': RGBColor(0, 0, 0),
        'background': RGBColor(255, 255, 255)
    }
    
    DARK_THEME = {
        'primary': RGBColor(79, 129, 189),
        'secondary': RGBColor(128, 128, 128),
        'text': RGBColor(255, 255, 255),
        'background': RGBColor(32, 32, 32)
    }
    
    GREEN_THEME = {
        'primary': RGBColor(112, 173, 71),
        'secondary': RGBColor(169, 208, 142),
        'text': RGBColor(0, 0, 0),
        'background': RGBColor(255, 255, 255)
    }
    
    RED_THEME = {
        'primary': RGBColor(192, 80, 77),
        'secondary': RGBColor(217, 149, 148),
        'text': RGBColor(0, 0, 0),
        'background': RGBColor(255, 255, 255)
    }